INCLUDE = -I. -I/usr/include
#LDLIBS =   -lglut -lXext -lX11 -lXmu -lXi -lGL -lGLU -lm -lSDL -lSDL_mixer
CFLAGS = -c -Wall
LDLIBS =   -lglut -lXext -lX11 -lXmu -lXi -lGL -lGLU -lm 
LDFLAGS =   -L/usr/X11R6/lib -L/usr/lib -L/lib

#program:
#	   	$(CC) $(GCCFLAGS) $(INCLUDE) $(FILENAME).cpp $(LDFLAGS) $(LDLIBS) -o $(FILENAME)

all: bump
	./bump

bump: bump_main.o manipulator.o BMPLoader.o bump_main.o manipulator.o vcylinder.o vgrid.o vmatrix.o vmesh.o vshader.o vshape.o vsphere.o vtexture.o vtorus.o glew.o algebra.o
	gcc -o bump $(LDFLAGS) $(LDLIBS) bump_main.o BMPLoader.o manipulator.o  vcylinder.o vgrid.o vmatrix.o vmesh.o vshader.o vshape.o vsphere.o vtexture.o vtorus.o glew.o  algebra.o

manipulator.o: manipulator.cpp manipulator.h vector.h glheader.h
	gcc $(CFLAGS) manipulator.cpp $(INCLUDE)

vcylinder.o: vcylinder.cpp vcylinder.h algebra.h
	gcc $(CFLAGS) vcylinder.cpp

vgrid.o: vgrid.cpp vgrid.h vshape.h glheader.h
	gcc $(CFLAGS) vgrid.cpp $(INCLUDE)

vmatrix.o: vmatrix.cpp vmatrix.h glheader.h
	gcc $(CFLAGS) vmatrix.cpp $(INCLUDE)

vmesh.o: vmesh.cpp vmesh.h glheader.h
	gcc $(CFLAGS) vmesh.cpp $(INCLUDE)

vshader.o: vshader.cpp vshader.h glheader.h
	gcc $(CFLAGS) vshader.cpp $(INCLUDE)

vshape.o: vshape.cpp vshape.h glheader.h
	gcc $(CFLAGS) vshape.cpp $(INCLUDE)

vsphere.o: vsphere.cpp vshape.h VSphere.h vgrid.h 
	gcc $(CFLAGS) vsphere.cpp $(INCLUDE)

vtorus.o: vtorus.cpp vtorus.h vgrid.h 
	gcc $(CFLAGS) vtorus.cpp $(INCLUDE)

vtexture.o: vtexture.cpp vtexture.h glheader.h 
	gcc $(CFLAGS) vtexture.cpp $(INCLUDE)

BMPLoader.o: BMPLoader.cpp BMPLoader.h
	gcc $(CFLAGS) BMPLoader.cpp

algebra.o: algebra.c algebra.h
	gcc $(CFLAGS) algebra.c

glew.o: glew.c glew.h
	gcc $(CFLAGS) glew.c $(INCLUDE)

bump_main.o: bump_main.cpp glew.h glheader.h vshader.h vmatrix.h vmatrix.cpp vmesh.h VSphere.h vtorus.h vcylinder.h vtexture.h BMPLoader.h
	gcc $(CFLAGS) bump_main.cpp $(INCLUDE)

clean:
	rm -f bump bump_main.o manipulator.o BMPLoader.o bump_main.o manipulator.o  vcylinder.o vgrid.o vmatrix.o vmatrix_main.o vmesh.o vshader.o vshape.o vsphere.o vtexture.o vtorus.o
